def file_write():
    file_path="D:\\hello.txt"
    file=open(file_path,'w')
    file.write(input("已创建/打开文件hello.txt\n请写入："))
    file.close()
file_write()